package com.qf.smsplatform.gateway.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: sms-platform
 *
 * @author: 黄睿武
 * time: 2021/8/17 19:36
 * description:
 */

/**
 * 缓存模块的Client接口
 */
@FeignClient(value = "sms-platform-cache")
public interface CacheClient {


    /**
     * 根据key和field查询hash结构中的value
     * @param key  redis的key
     * @param field  redis的hashKey
     * @return
     */
    @GetMapping("/cache/hget/{key}")
    String hget(@PathVariable String key, @RequestParam String field);


    /**
     * 保存发送信息的记录,用来限流,看(五分钟\一小时\24小时内的短信次数)内是否超过次数
     * @param key
     * @param value
     */
    @RequestMapping(value = "/cache/saveliu", method = RequestMethod.POST)
    void saveZSet(@RequestParam("key") String key, @RequestParam("value") Long value);



}
